using System;
using System.IO;
using System.Text;
using System.Security.Cryptography;

namespace AnTunes
{
	class WebTrackInfo : TrackInfo
	{
		public WebTrackInfo(WebTrack track) : base(track)
		{
		}
		
		public override string Name
		{
			get
			{
				return ((WebTrack)track_).Url.ToString();
			}
		}
		
		protected override void UpdateHash()
		{	
			MD5 md5 = MD5.Create();
			md5.Initialize();
			
			byte[] data = Encoding.UTF8.GetBytes(((WebTrack)track_).Url.ToString());
			byte[] hashBytes = md5.ComputeHash(data);
			hash_ = Convert.ToBase64String(hashBytes);
		}
	}

}

